Efficient Multimethods in a Single Dispatch Language
نویسندگان
چکیده
Smalltalk-80 is a pure object-oriented language in which messages are dispatched according to the class of the receiver, or first argument, of a message. Object-oriented languages that support multimethods dispatch messages using all their arguments. While Smalltalk does not support multimethods, Smalltalk's reflective facilities allow programmers to efficiently add them to the language. This paper explores several ways in which this can be done, and the relative efficiency of each. Moreover, this paper can be seen as a lens through which the design issues raised by multimethods, as well as by using metaobjects to build them, can be more closely examined.
منابع مشابه
Context-Oriented Programming with the Ambient Object System
In this paper we present AmOS, the Ambient Object System that underlies the Ambience programming language. AmOS implements a computation model that supports highly dynamic behaviour adaptation to changing contexts. Apart from being purely object-based, AmOS features first-class closures, multimethods and contexts. Dynamic method scoping through a subjective dispatch mechanism is at the heart of...
متن کاملEfficient Multiple Dispatching Using Nested Transition-Arrays
Efficient implementation of multiple dispatching is critical with regard to the success of the multimethods, which are recognized as a powerful mechanism in object-oriented programming languages. However, the current known time-efficient approaches suffer of poor space efficiency. This paper presents a novel multiple dispatching approach that substantially improves the space efficiency over the...
متن کاملBeCecil, A Core Object-Oriented Language with Block Structure and Multimethods: Semantics and Typing
We present and analyze the semantics and static type system for BeCecil, a theoretical (core) language with multimethods. BeCecil is a simple and orthogonal version of object-oriented languages like Cecil, CLOS, and Dylan. BeCecil has a new, simple mechanism for information hiding, which allows subclassing and yet can preserve representation invariants. BeCecil is also block-structured; within ...
متن کاملMultimethods for Context-Awareness
The increasing availability of mobile devices and the wireless networks that connect them sets the stage for the introduction of contextaware applications. Current context-aware applications typically achieve adaptation to context by hard-coding decisions. In this paper we present an alternative approach based on classless objects in combination with distributed multimethods to develop more fle...
متن کامل